package com.quanyan.ic.parkingLot.http.controller;

import com.quanyan.ic.common.http.APIResponse;
import com.quanyan.ic.parkingLot.http.entity.TbTest;
import com.quanyan.ic.parkingLot.http.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhang on 17/8/18.
 */
@RestController
@RequestMapping(value = "/api/parking/test")
public class TestController {
    @Autowired
    private TestService testService;

    @RequestMapping("queryTestById")
    public APIResponse queryTestById(@RequestParam Integer id) {
        TbTest test = testService.queryTestById(id);
        return APIResponse.returnSuccess(test);
    }

    @RequestMapping("insertTest")
    public APIResponse insertTest(@RequestBody TbTest test) {
        TbTest result = testService.insertTest(test);
        return APIResponse.returnSuccess(result);
    }
}
